# Python脚本在目录中删除空文件夹
import os
import sys

def remove_empty_folders(directory_path):
    for root, dirs, files in os.walk(directory_path, topdown=False):
        for folder in dirs:
            folder_path = os.path.join(root, folder)
            if not os.listdir(folder_path):
                print(f"Deleting empty folder: {folder_path}")
                os.rmdir(folder_path)

if __name__ == "__main__":
    if len(sys.argv) != 2:
        print("Usage: python3 remove_empty_folders.py path")
        sys.exit(1)
    
    remove_empty_folders(sys.argv[1])